package examsrv

import "gitee.com/chuanjinge/gopkgserv/internal/dao"

// CheckExamBelongsToUser 检查 examId 是否属于 userId
func CheckExamBelongsToUser(examId int, userId int64) *dao.ExamExams {
	exam, err := dao.GetExamByID(examId)
	if err != nil {
		return nil
	}
	if int64(exam.UserID) != userId {
		return nil
	}
	return exam
}
